﻿
@{
    ViewBag.Title = "OrderAudit";
    Layout = "~/Views/Shared/layoutCommon.cshtml";
}

@section style{
    <style>
        .form-horizontal .control-label {
            width: 20%;
            float: left;
            text-align: right;
        }

        .col-sm-3 {
            width: 80%;
            float: left;
        }
    </style>
    <link href="@Url.Content("~/css/plat/blue.css")" rel="stylesheet">
}
<form id="form1" class="form-horizontal">
    <section class="content">
        <div class="row">
            <div class="col-md-12">
                <div class="box-body">
                    <div class="form-group" id="divAuditResult">
                        <label class="col-sm-2 control-label" for="name">审核结果：</label>
                        <div class="col-sm-3">
                            <label class="radio-inline">
                                <input type="radio" value="1" name="rdAuditResult" checked="checked">通过
                            </label>
                            <label class="radio-inline">
                                <input type="radio" value="2" name="rdAuditResult">驳回
                            </label>
                        </div>
                        </div>
                    <div class="form-group" style="display:none;" id="divReject">
                        <label class="col-sm-2 control-label" for="name">驳回原因：</label>
                        <div class="col-sm-3">
                            <textarea name="txtRemark" rows="2" cols="20" id="txtRemark" class="form-control" style="width:300px;"></textarea>
                        </div>
                    </div>
                </div>
                <div class="box-footer text-center">
                    <button class="btn btn-primary" type="button" id="btnSave">确 定 </button>
                    <button class="btn" type="button" id="cancel">取 消 </button>
                </div>
            </div>

        </div>
        <!-- /.row -->
    </section>

</form>
@section scriptsBottom{
    <script src="@Url.Content("~/js/icheck.min.js")"></script>
    <script type="text/javascript">
       $(document).ready(function () {
           $('input').iCheck({
               radioClass: 'iradio_flat-blue'
           });

           $("#btnSave").click(function(){
               save();
           });
           $("#cancel").click(function () {
               BMCW.closeTopLayer();
           });

           $("#divAuditResult").find("input").each(function () {
               $(this).click(function () {
                   if ($(this).val() == 2) {
                       $("#divReject").show();
                   } else {
                       $("#divReject").hide();
                   }
               })
               
           });
         
       });
    

       function save()
       {
           var bootstrapValidator = $("#form1").data('bootstrapValidator');
           bootstrapValidator.validate();

           if (bootstrapValidator.isValid()) {
               var isShow = 0;
               if($("#chkIsShowIndex").prop("checked")==true)
               {
                   isShow = 1;
               }
               var url = '@Url.Action("SaveBizType", "BasicData")'
               BMCW.ajax({
                   url: url,
                   type: "Post",
                   data: {
                       MasterBizTypeID: $("#selMasterBizType").val(),
                       BizTypeName: $("#txtName").val(),
                       BizTypeSort: $("#txtSort").val(),
                       IsShowIndex:isShow,
                       BizTypeIcon: $("#txtIcon").val(),
                       BizTypePinYin:$("#txtPinYin").val()
                   },
                   success: function (o) {
                       if (o.status == 0) {
                           BMCW.msg("保存成功",function(){
                               BMCW.getTopSelectedWin().search();
                           });
                       } else {
                           BMCW.alert("保存失败");
                       }
                   }
               });
           }
       }

       
    </script>
}

